﻿<!DOCTYPE>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>	
<%
	String path = request.getContextPath();
	//获得本项目的地址(例如: http://localhost:8080/MyApp/)赋值给basePath变量 
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	pageContext.setAttribute("basePath", basePath);
	pageContext.setAttribute("path", path);
%>
<html>
<head>
<link rel="stylesheet" type="text/css" href="${basePath}css/style.css" />
<script type="text/javascript" src="${basePath}js/jquery-3.2.1.js"></script>
<title>适合简历</title>
<meta content="description" name="description">
<meta content="keywords" name="keywords">
</head>
<body>
<div id="body">
	<%@include file="../header.jsp"%>
    <div id="container">
        <%@include file="../left.jsp"%>
            <div class="content">
            	<dl class="company_center_content">
                    <dt>
                        <h1><em></em>适合简历</h1>
                    </dt>
                    <dd>
                    	<form method="post" id="filterForm">
		                        <div class="filter_options  dn ">
 								</div>	                        	                        		                        
 						<ul class="reset resumeLists" id="dataUl">
		                </ul><!-- end .resumeLists -->
		                    </form>
                    </dd>
                </dl>
            </div><!-- end .content -->

	    </div><!-- end #container -->
	</div><!-- end #body -->


<!--  -->

<script type="text/javascript">
$(function(){
	resumesInfo("","yes");
});
function resumesInfo(isRead,isPass){
	$.ajax({
		type : 'post',
		url : '${basePath}hr/resumesInfo',
		dataType : "json",
		data : {
			isRead : isRead,
			isPass : isPass
		},
		success : function(result) {
			var model = result.model;
			console.log("提交成功");
			if (model.code == 0) {
				var list = model.list;
				$("#dataUl").html("");
				if (list.length == 0) {
					$("#dataUl").append('<div class="addnew">没有相应信息……<br></div>');
				}
				for (var i = 0; i < list.length; i++) {
					var tem = "";
					tem += '<li class="onlineResume"><div class="resumeShow">';
					tem += '<div class="resumeIntro"><h3 class="unread"><a target="_blank" title="预览简历" href="${basePath}user/getResumeInfo/'+model.list[i].userId+'">'+model.list[i].userName+'的简历';
					tem += '</a><em></em></h3><span class="fr">投递时间：'+new Date(list[i].resumeTime).toLocaleDateString();
					tem += '</span><div> '+list[i].userName+'/'+list[i].edu+' / '+list[i].city+'</div><div class="jdpublisher">';
					tem += '<span>应聘职位：<a title="" target="_blank" href="${basePath}user/jobDetail/'+list[i].riId+'">'+list[i].position+'</a>';
					tem += '</span></div></div><div class="links"><a class="resume_notice" href="javascript:dopass(\''+list[i].criId+'\')">通过</a>';
					tem += '<a class="resume_refuse" href="javascript:doNopass(\''+list[i].criId+'\')">不合适</a></div></div></li>';
					
					$("#dataUl").append(tem);
				}
			}else{
				console.log(model.msg);
				alert(model.msg);
			}
		},
		error : function(){
			alert("系统异常");
		}
	});
}
function dopass(id){
	updateInfo(id,"yes");
}
function doNopass(id){
	updateInfo(id,"no");
}
function updateInfo(id,ispass){
	$.ajax({
		type : 'post',
		url : '${basePath}hr/updatecri',
		dataType : "json",
		data : {
			id : id,
			isPass : ispass
		},
		success : function(result){
			var model = result.model;
			console.log("提交成功");
			if (model.code == 0) {
				alert("操作成功");
				resumesInfo("","yes");
			}
		},
		error:function(){
			
		}
	});
}
</script>

</body></html>